<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <css file="__PUBLIC__/css/base.css"/>
        <link type="text/css" href="__ROOT__/data/ui/css/flick/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
        <script type="text/javascript" src="__ROOT__/data/ui/js/jquery-1.8.0.min.js"></script>
        <script type="text/javascript" src="__ROOT__/data/ui/js/jquery-ui-1.8.23.custom.min.js"></script>
		<script type="text/javascript" src="__ROOT__/data/Validform_v5.1_min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/js/validate.js"></script>
		<script type="text/javascript" src="__PUBLIC__/js/admin.js"></script>
		<script type='text/javascript' src='__DATA__/datepicker/zebra_datepicker.js'></script>
		<link rel="stylesheet" type="text/css" href="__DATA__/datepicker/zebra_datepicker.css" />
		<jsconst />
		<script type="text/javascript">
            $(function(){
                $("#tabs").tabs();
            });
			/**调用日历**/
			$(function(){
				$('#datepicker-startDate').Zebra_DatePicker({
					direction: true,
					pair: $('#datepicker-endDate')
				});
				$('#datepicker-endDate').Zebra_DatePicker({
					direction: 1
				});
			});
        </script>
    </head>
    <body>
        <div class="now_path">
            <strong>您现在的位置：</strong>
            房屋管理>增加房屋
        </div>
		<div class="success_box">所有的选项都填写正确</div>
    	<div class="error_box"></div>
        <div id="tabs" style="width:100%">
            <ul>
                <li><a href="#tabs-1">添加房屋</a></li>
				<li><a href="#tabs-2">房屋信息</a></li>
				<li><a href="#tabs-3">房屋设施</a></li>
            </ul> 
			<form action="__CONTROL__/modify_exe" method="post" class='tujia'>
            <div id="tabs-1">
                <table class="table2">
                    <tr>
                        <th>房屋名称：</th>
                        <td><input type="text" name="title" style="width:360px;"  value='{$house.title}' nullmsg="请输入房屋名称！" datatype='*' class='inputvalidata'/>
						<span class="Validform_checktip"></span>
						</td>
                    </tr>
					<tr>
                        <th>位置：</th>
                        <td>
							<select name='cid' id='city'>
								<option value=''>==请选择城市==</option>
								<foreach from='$citys' value='$v'>
									<if value='$v.cid eq $house.cid'>
									<option value='{$v.cid}' selected='selected'>{$v.cname}</option>
									<else />
									<option value='{$v.cid}'>{$v.cname}</option>
									</if>
								</foreach>
							</select>
							<select name='qid' id='xiaoqu'>
								<foreach from='$xiaoqu' value='$v'>
									<option value='{$v.qid}' <if value='$v.qid eq $house.qid'>selected='selected'</if>>{$v.qname}</option>
								</foreach>
							</select>
						</td>
                    </tr>
					<tr>
                        <th>房屋景区：</th>
                        <td>
							<select name='jid' id='jingqu' msgerror= '请选择景区！' datatype='*' style=' display:block; float:left;'>
								<foreach from='$jignqu' value='$v'>
									<option value='{$v.jid}' <if value='$v.jid eq $house.jid'></if>>{$v.jname}</option>
								</foreach>
							</select>
							<div class="Validform_checktip"></div>
						</td>
                    </tr>
					<tr>
                        <th>房屋价格：</th>
                        <td><input type="text" name="price" style="width:100px;" value='{$house.price}'  nullmsg="请输入房屋价格！" datatype='n' msgerror='价格必须为数字!' class='inputvalidata'/>
						<span class="Validform_checktip"></span>
						</td>
                    </tr>
					<tr>
                        <th>开始时间：</th>
                        <td><div style=' position:relative;'><input type="text" value='{$house.startDate|date:"Y-m-d",@@}' name="startDate" id='datepicker-startDate' style='width:150px;'/></div>
						</td>
                    </tr>
					<tr>
                        <th>结束时间：</th>
                        <td><div style=' position:relative;'><input type="text" value='{$house.endDate|date:"Y-m-d",@@}' name="endDate" id='datepicker-endDate' style='width:150px;'/></div>
						</td>
                    </tr>
					<tr>
                        <th>房屋缩略图：</th>
						<input type='hidden' name='thumb' value='' /> 
                        <td><upload name='thumb' imagesize='150,110' limit='1' text='上传缩略图'/>
						</td>
                    </tr>
					<tr>
                        <th>房屋图片集(670x390)：</th>
						<input type='hidden' name='house_data[images]' value='' /> 
                        <td><upload name='house_data[images]' imagesize='70x43' limit='1' text='上传图片'/>
						</td>
                    </tr>
					<tr>
                        <th>房屋介绍：</th>
                        <td><editor name='house_data[house_jieshao]' height='250' content='{$house.house_jieshao}' />
						</td>
                    </tr>
					<tr>
                        <th>是否显示：</th>
                        <td><if value='$house.status eq 1'>
                        	<input type="radio" name="status"  checked='checked' value='1'/>是&nbsp;
                        	<input type="radio" name="status" value='0'/>否
							<else />
							<input type="radio" name="status"  checked='checked' value='1'/>是&nbsp;
							<input type="radio" name="status" value='0' checked='checked' />否
							</if>
						</td>
                    </tr>
                </table>
            </div>
			<div id="tabs-2">
				<table class='table2'>
					<tr>
                        <th>房屋数量：</th>
                        <td><input type='text' name='num' value='1'  value='{$house.num}' class='inputvalidata' style="width:60px;"   nullmsg='房屋数量不能为空' datatype='n'/>
							<span class="Validform_checktip"></span>
						</td>
                    </tr>
					<tr>
                        <th>是否接机：</th>
                        <td><input type='radio' name='jieji' value='1' <if value='$house.jieji eq 1'>checked='checked'</if>/>是&nbsp;
						<input type='radio' name='jieji' value='0' <if value='$house.jieji eq 0'>checked='checked'</if> />否&nbsp;
						</td>
                    </tr>
					<tr>
                        <th>登记入住前厅地址：</th>
                        <td><input type="text" name="qianting" style="width:360px;" value='{$house.qianting}' class='inputvalidata' style="width:360px;"  nullmsg='前厅地址不能为空' datatype='s5-20'/>
							<span class="Validform_checktip"></span>
						</td>
                    </tr>
					<tr>
                        <th>管理公司：</th>
                        <td><select name='company' id='company' msgerror='请选择管理公司' datatype='*' class='selectvalidata'>
								<foreach from='$companys' value='$v'>
									<option value='{$v.comid}' <if value='$v.comid eq $house.company'>selected='selected'</if>>{$v.comname}</option>
								</foreach>
							</select>
							&nbsp;&nbsp;<a href='__WEB__/admin/company/addcompany' style=' text-decoration:underline; display:block; float:left;' target='_blank'>添加管理公司</a>
							<div class="Validform_checktip"></div>
						</td>
                    </tr>
					<tr>
                        <th>推荐入住人数：</th>
                        <td><select name='ruzhu'>
                        	<?php for($i=1;$i<=10;$i++){ ?>  
								<option value='{$i}' <if value='$house.ruzhu eq $i'>selected='selected'</if>>{$i}</option>
							  <?php } ?>
							</select>人
						</td>
                    </tr>
					<tr>
                        <th>床数量：</th>
                        <td>
							<select name='chuang'>
                        	<?php for($i=1;$i<=10;$i++){ ?>  
								<option value='{$i}' <if value='$house.chuang eq $i'>selected='selected'</if>>{$i}</option>
							  <?php } ?>
							</select>张
						</td>
                    </tr>
                    <tr>
                        <th>卧室数量：</th>
                        <td>
							<select name='woshi'>
                        	<?php for($i=1;$i<=10;$i++){ ?>  
								<option value='{$i}' <if value='$house.woshi eq $i'>selected='selected'</if>>{$i}</option>
							  <?php } ?>
							</select>间 
						</td>
                    </tr>
					<tr>
                        <th>房屋面积：</th>
                        <td><input type="text" name="area" class='inputvalidata' value='{$house.area}' style="width:60px; display:inline-block;" nullmsg='房屋面积不能为空' datatype='n' errormsg='房屋面积不正确'/><div style='float:left;'>平方</div>
							<span class="Validform_checktip"></span>
						</td>
                    </tr>
					<tr>
                        <th>可以加床？：</th>
                        <td>
							<select name='jiachuang'>
								<option value='0' <if value='$house.jiachuang eq 0'>selected='selected'</if>>不能加床</option>
								<?php  for($i=1;$i<=5;$i++){ ?>
									<option value='{$i}' <if value='$house.jiachuang eq $i'>selected='selected'</if>>+{$i}</option>
								<?php } ?>
							</select>
						</td>
                    </tr>
					<tr>
                        <th>房屋格局：</th>
                        <td>
                        	<select name='geju[]'>
                        		<?php  for($i=1;$i<=5;$i++){ ?>
									<option value='{$i}' <if value='$house.geju.0 eq $i'>selected='selected'</if>>{$i}</option>
								<?php } ?>
                        	</select>室
                        	<select name='geju[]'>
                        		<?php  for($i=1;$i<=5;$i++){ ?>
									<option value='{$i}' <if value='$house.geju.1 eq $i'>selected='selected'</if>>{$i}</option>
								<?php } ?>
                        	</select>厅
                        	<select name='geju[]'>
                        		<?php  for($i=1;$i<=5;$i++){ ?>
									<option value='{$i}' <if value='$house.geju.2 eq $i'>selected='selected'</if>>{$i}</option>
								<?php } ?>
                        	</select>卫
						</td>
                    </tr>
					
					<tr>
                        <th>房屋地址：</th>
                        <td><input type="text" name="address" class='inputvalidata' style="width:360px;" value='{$house.address}' nullmsg='房屋地址不能为空' datatype='s5-20'/>
							<span class="Validform_checktip"></span>
						</td>
                    </tr>
					<tr>
                        <th>房屋样式：</th>
                        <td>
                        	<foreach from='$yangshi' value='$v'>
								<label from='yangshi'><input id='yangshi' type='radio' name='yangshi' value='{$v.yname},{$v.yid}' <if value='$house.yangshi eq $v.yname'>checked='checked'</if>/>{$v.yname}</label>
							</foreach>
						</td>
                    </tr>
					<tr>
                        <th>其他服务(<a href='javascript:;' id='addOtherServer' index='<?php echo  count($otherserver);?>'>&nbsp;<font style='color:red;'>加</font>&nbsp;</a>)：</th>
                        <td>
                        	<table class='table5'>
                        		<tr>
                        			<td style='width:100px;'>服务项目</td>
									<td width='500'>服务内容</td>
                        		</tr>
                        		<foreach from='$otherserver' value='$v'>
	                        		<tr class='yonghu'>
	                        			<td style='width:100px;'><input value='{$v.fwname}' type='text' name='house_otherserver[1][]' style='display:bloack; width:100px;'></td>
										<td><input type='text' value='{$v.value}' name='house_otherserver[1][]' style='width:700px; display:block;'></td>
	                        		</tr>
                        		</foreach>
                        	</table>
                        </td>
                    </tr>
					
				</table>
			</div>
			<div id="tabs-3">
				<table class='table2'>
					<tr>
						<td>房间设施:</td>
						<td>
							<foreach from='$sheshi' value='$v'>
								<label><input type='checkbox' name='house_sheshi_rel[][hsid]' value='{$v.hsid}' <if value='in_array($v["hsid"],$house["house_sheshi"])'>checked='checked'</if> />{$v.sname}&nbsp;</label>
							</foreach>
						</td>
					</tr>
					<tr>
						<td>提供服务</td>
						<td>
							<foreach from='$fuwu' value='$v'>
								<label><input type='checkbox' name='house_fuwu_rel[][fwid]' value='{$v.fwid}'<if value='in_array($v["fwid"],$house["house_fuwu"])'>checked='checked'</if> />{$v.fwname}&nbsp;</label>
							</foreach>
						</td>
					</tr>
					<tr>
						<td>物品及其位置(<a href='javascript:;' id='addPosition' index='<?php echo count($position); ?>'>&nbsp;<font style='color:red;'>加</font>&nbsp;</a>):</td>
						<td>
							<table class='table5'>
                        		<tr>
                        			<td>位置</td>
                        			<td>物品名称</td>
                        			<td>规格</td>
									<td>数量</td>
                        		</tr>
                        		<foreach from='$position' value='$v'>
	                        		<tr>
	                        			<td>
	                        				<select name='house_position[1][weizhi]'>
	                        					<option value='卧室' <if value='$v.weizhi eq "卧室"'>selected='selected'</if>>卧室</option>
	                        					<option value='客厅' <if value='$v.weizhi eq "客厅"'>selected='selected'</if>>客厅</option>
	                        					<option value='阳台' <if value='$v.weizhi eq "阳台"'>selected='selected'</if>>阳台</option>
	                        					<option value='厨房' <if value='$v.weizhi eq "厨房"'>selected='selected'</if>>厨房</option>
	                        					<option value='卫生间' <if value='$v.weizhi eq "卫生间"'>selected='selected'</if>>卫生间</option>
	                        					<option value='其他' <if value='$v.weizhi eq "其他"'>selected='selected'</if>>其他</option>
	                        				</select>
	                        			</td>
	                        			<td><input type='text' name='house_position[1][sheshi]' style='width:200px;' value='{$v.sheshi}'/></td>
	                        			<td><input type='text' name='house_position[1][guige]'  style='width:200px;' value='{$v.guige}'/></td>
	                        			<td><input type='text' name='house_position[1][shuliang]'  style='width:200px;' value='{$v.shuliang}'/></td>
	                        		</tr>
                        		</foreach>
                        	</table>
						</td>
					</tr>
					<tr>
						<td>房屋特色:</td>
						<td style='width:900px;'>
							<foreach from='$tese' value='$v'>
								<label><input type='checkbox' name='house_tese_rel[][tsid]' value='{$v.tsid}'<if value='in_array($v["tsid"],$house["house_tese"])'>checked='checked'</if> />{$v.tsname}&nbsp;</label>
							</foreach>
						</td>
					</tr>
				</table>
			</div>
			<input type='hidden' name='id' value='{$house.id}' />
			<input type="submit" class="submit" value="添加文章" name='submit'/>
			</form>
        </div>
    </body>
</html>
